<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setAttribute("basePath", basePath);
String respondResultJson= (String)request.getAttribute("respondResultJson");
%>
<html>
<head>
<title>病案系统-数据平台</title>
<link rel="stylesheet" href="${basePath}assets/bootstrap/css/bootstrap.css"/>
<link href="${basePath}assets/css/basic.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="${basePath}assets/css/list.css"/>
<link rel="stylesheet" href="${basePath}assets/css/login.css"/>
<script type="text/javascript" src="${basePath}assets/jquery/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}assets/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="${basePath}assets/js/header.js"></script>
<script type="text/javascript" src="${basePath}assets/layer/layer.js"></script>
<script type="text/javascript" src="${basePath}assets/js/print/print.js"></script>
 <script src="${basePath}assets/jqprint/jquery-migrate-1.2.1.min.js"></script> 
<script src="${basePath}assets/jqprint/jquery.jqprint-0.3.js"></script>
<script src="${basePath}assets/rotate/jquery.rotate.min.js"></script>
<link href="${basePath}assets/css/print.css" rel="stylesheet" type="text/css"><%-- 
<link href="${basePath}/static/layer/layer_defined.css" rel="stylesheet" type="text/css"> --%>

<script type="text/javascript">
		$(function(){
			var respondResultJson= <%=respondResultJson%>;
			console.log(respondResultJson);
			if(respondResultJson){
				if(!respondResultJson.success){
					if(respondResultJson.stateCode = "404"){
						layer.msg(respondResultJson.stateMessage);
					}
				}else{
					var record = respondResultJson['data'];
					var mrId =record['mr_id'];
					var visitNumber =record['visit_number'];
					var patientName =record['patient_name'];
					var outHospitalDate =record['out_hospital_date'];
					var title="姓名:"+patientName +"&nbsp;&nbsp;&nbsp;病案号:"+mrId+"&nbsp;&nbsp;&nbsp;住院次数:"+visitNumber+"&nbsp;&nbsp;&nbsp;出院日期:"+outHospitalDate;
					
					
					$("#title").html(title);
					$(".file_manage").removeAttr("hidden");
					initPage();
				}
			}
		});
		
		function print(){
			$("#filePage img.delete_img").hide();
			$("#print_div").jqprint();
		}
	</script>

</head>
<body>
    <div class="file_manage" hidden="hidden">

    <div class="file_title">
    	<h3 id="title">打印</h3>
    	<input type="hidden" id="basePath" value="${basePath }"/>
    	<input type="hidden" id="visitGuid" value="${visitGuid }">
    	<form action="${basePath}medical_record_scan/paginationMedrecordImages" hidden="hidden"  id="paginationForm">
    		<input type="hidden" id="firstGuid" name="visitGuid" value="${visitGuid }">
    	</form>
        <ul style="width:100px;">
            <li id="print-a" hidden="hidden" ><a onclick="print()">打印</a></li>
        </ul>
    </div>
    <div class="fileContent clearfix">
        <div class="fileContent-left" style="width: 100%;">
            
                <div class="right">打印页数:&nbsp;<span id="totalFileCount">0<%-- ${fn:length(scanFiles)} --%></span>&nbsp;&nbsp;&nbsp;&nbsp;</div>
            </div>
        <!--<h4 style="height:35px;line-height: 35px;width:965px;margin:0 0 5px;background:#e3e5e4;padding-left:25px;">文件对照信息</h4>-->
            <div class="filePage" id="filepage" style="width: 100%;">
            	<div id="print_div" style="width: 1150px;">
            		<c:forEach var="scanFile" items="${scanFiles }" varStatus="status">
               		
	               		<div class="a4-endwise">
	               		<img class="delete_img" style="width:22px; position:absolute;" onclick="deleteImg(this)" src="${basePath}assets/images/delete.png">
							
	               			<img src="${basePath}medical_record_scan/ajax_image_stream?fileHash=${scanFile.file_hash}" alt=""/>
	               			
	   					</div>
	   					<div style="page-break-after: always;"></div>  
	               	</c:forEach> 
            	</div>
            	
                
               <%--  <ul id="image_url">
                		
                	<c:forEach var="scanFile" items="${scanFiles }" varStatus="status">
                		<li class="a4-endwise" style="position:relative" id="${scanFile.image_id}" page-type-sort-index="${scanFile.page_type_sort_index}" image-sort-index="${scanFile.sort_index}" file-hash="${ scanFile.file_hash}">
                			 
                			<img src="${basePath}medical_record_scan/ajax_image_stream?fileHash=${scanFile.file_hash}" alt=""/>
                			<div style="position:absolute;top:0;right:0;"><a class="int" onclick="deleteImg(this)">移除</a></div>
                			
                		</li>
                		
                	</c:forEach>  
                </ul> --%>
            </div>
        </div>
      
        
</div>
</body>
</html>
